﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="BillCustomer.aspx.cs" Inherits="Billing2.BillCustomer" %>
<%@ Register Src="~/Controls/Admin/ucBillCustomer.ascx" TagName="ucBillCustomer" TagPrefix="uc1" %>
<%@ Register src="~/Controls/ucPageTitle.ascx" tagname="ucPageTitle" tagprefix="uc2" %>
<%@ Register src="~/Controls/ucInProgress.ascx" tagname="ucInProgress" tagprefix="uc3" %>
<%@ Register src="~/Controls/ucSearch.ascx" tagname="ucSearch" tagprefix="uc4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            // Dialog 
            $('#dialogSave').dialog({
                autoOpen: false,
                width: 800,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));

            $('#dialogUpdate').dialog({
                autoOpen: false,
                width: 800,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <uc2:ucPageTitle ID="ucPageTitle1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
    <ContentTemplate>
         <uc4:ucSearch ID="ucSearch" runat="server" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <br />    
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gvView" runat="server"
                CssClass="sTable bilGrid" AutoGenerateColumns="False" 
                OnRowCommand="gvView_RowCommand" 
                AllowSorting="True" EnableSortingAndPagingCallbacks="True" 
                onpageindexchanging="gvView_PageIndexChanging"                 
                PageSize="50" onsorting="gvView_Sorting" EnableTheming="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal">
                <PagerSettings PageButtonCount="50" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle CssClass="row" />
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle CssClass="gridHeaderNoicon" BackColor="#333333" Font-Bold="True" Font-Size="11px" ForeColor="White" />
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="No">
                        <ItemTemplate>
                            <asp:Label ID="xCol01" runat="server" Text='<%#Container.DataItemIndex+1  %>'></asp:Label>
                        </ItemTemplate>                       
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="Customer No" SortExpression="CustNo">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="linkBtnEdit" CommandArgument='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ID")))%>' CommandName="EditData" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CustNo")))%>' ></asp:LinkButton>
                        </ItemTemplate>                      
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Short Name" 
                        SortExpression="CustName1">
                        <ItemTemplate>
                            <asp:Label ID="xCol03" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CustName1")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Customer Name" 
                        SortExpression="CustName2">
                        <ItemTemplate>
                            <asp:Label ID="xCol04" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CustName2")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Business Unit" 
                        SortExpression="BUCode">
                        <ItemTemplate>
                            <asp:Label ID="xCol05" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("BUCode")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Address" 
                        SortExpression="Address">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("Address")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Contact Person" 
                        SortExpression="ContactPerson">
                        <ItemTemplate>
                            <asp:Label ID="xCol07" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ContactPerson")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Special Instruction" 
                        SortExpression="SpecialInstruction">
                        <ItemTemplate>
                            <asp:Label ID="xCol09" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("SpecialInstruction")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Telephone No" 
                        SortExpression="TelNo">
                        <ItemTemplate>
                            <asp:Label ID="xCol10" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("TelNo")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Fax No" 
                        SortExpression="FaxNo">
                        <ItemTemplate>
                            <asp:Label ID="xCol11" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("FaxNo")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Email Address" 
                        SortExpression="EmailTo">
                        <ItemTemplate>
                            <asp:Label ID="xCol12" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("EmailTo")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Group By" 
                        SortExpression="GroupBy">
                        <ItemTemplate>
                            <asp:Label ID="xCol13" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("GroupBy")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Organization ID" 
                        SortExpression="OrgIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol14" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("OrgIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Site ID" 
                        SortExpression="SiteIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol15" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("SiteIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Cost Centre IDs" 
                        SortExpression="CostCentreIDNames">
                        <ItemTemplate>
                            <asp:Label ID="xCol16" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CostCentreIDNames")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Last Modified" 
                        SortExpression="ModifiedDateTime">
                        <ItemTemplate>
                            <asp:Label ID="xCol17" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ModifiedDateTime","{0:dd/MM/yyyy hh:mm:ss tt}")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>                
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnAdd" runat="server" Text="Add" CausesValidation="false" CssClass="ui-state-default ui-corner-all"
                OnClick="btnAdd_Click" />
        </ContentTemplate>        
    </asp:UpdatePanel>
    
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel3">
        <ProgressTemplate>
            <uc3:ucInProgress ID="ucInProgress1" runat="server" />        
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
        <ProgressTemplate>
            <uc3:ucInProgress ID="ucInProgress2" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    
    <div id="dialogSave" title="Add Billing Customer" style="display: none">
        <div id="dialogSaveEffect">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                   <uc1:ucBillCustomer ID="ucBillCustomer1" runat="server" />
               </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    
    <div id="dialogUpdate" title="Edit Billing Customer" style="display: none">
        <div id="dialogUpdateEffect">
            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                <ContentTemplate>
                  <uc1:ucBillCustomer ID="ucBillCustomer2" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>        
    </div>
</asp:Content>
